import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/system',
  component: Layout,
  redirect: '/system/menu',
  name: 'system',
  meta: {
    title: '系统设置',
    icon: 'i-heroicons-solid:menu-alt-3',
  },
  children: [
    {
      path: 'user',
      name: '用户管理',
      component: () => import('@/views/system/user/index.vue'),
      meta: {
        title: '用户管理',
      },
    },
    {
      path: 'role',
      name: '角色管理',
      component: () => import('@/views/system/role/index.vue'),
      meta: {
        title: '角色管理',
      },
    },
    {
      path: 'menu',
      name: '菜单管理',
      component: () => import('@/views/system/menu/index.vue'),
      meta: {
        title: '菜单管理',
      },
    },
    {
      path: 'dict',
      name: '字典管理',
      component: () => import('@/views/system/dict/index.vue'),
      meta: {
        title: '字典管理',
      },
    },
  ],
}

export default routes
